<template>
  <div class="school">
      <el-table
      :data="list"
      style="width: 50%"
      :row-class-name="tableRowClassName"
      :header-cell-style="{background:'#F0F2F5'}"
      >
      <el-table-column prop="key" label="编号" ></el-table-column>
      <el-table-column prop="school" label="学院名称" ></el-table-column>
       <el-table-column prop="aa" label="人数" ></el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
   data(){
    return {
      list:[]
    }
    },
    mounted(){
    this.getlist()
  },
  methods:{
     tableRowClassName({row, rowIndex}) {
        if (rowIndex%2==0) {
          return 'warning-row';
        } else if (rowIndex%2==1) {
          return 'success-row';
        }
        return '';
      },
    getlist(){
      this.$httpAxios(this.$api.GETSHOOL(),res=>{
        this.list=res.data
      })
    }
  }
}
</script>
<style>
  .el-table .warning-row {
    background: #ffff ;
  }
 .el-table .success-row {
    background: #F0F2F5;
  }
</style>
